FUNCTION_BLOCK DAC_DwordTo2Words 
TITLE = 'DAC_DwordTo2Words'
//
// This functionblock build 2 single words of a dword  
// 
// Versionshistory:
// 1.0 Ersterstellung E.Dittmann

VERSION : '1.0'
AUTHOR  : 'Lenze'
FAMILY  : 'DAC'
NAME : '2wOfdw'
KNOW_HOW_PROTECT

VAR_INPUT
    dwInput:                     DWORD;                             // Inputdword
END_VAR
    

VAR_OUTPUT
    wOutput1:                    WORD;                              // Outputword 1
    wOutput2:                    WORD;                              // Outputword 2
END_VAR
    
VAR
END_VAR

BEGIN

    wOutput1:=DWORD_TO_WORD(dwInput);
    wOutput2:=DWORD_TO_WORD(SHR(IN:=dwInput,N:=16));

END_FUNCTION_BLOCK